import Vue from 'vue'
import Router from 'vue-router'
import WebSiteBaseLayout from './layouts/WebSiteBase.vue'
import Index from './views/website/Index.vue'
import Login from './views/website/Login'
import Register from  './views/website/Register'

import AdminBaseLayout from './layouts/AdminBase.vue'
import Home from './views/admin/Home.vue'
import About from './views/admin/About.vue'
import Dashboard from './views/admin/Dashboard.vue'
import UserList from './views/admin/UserList.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: WebSiteBaseLayout,
      children: [
        {
          path: '',
          name: 'index',
          component: Index
        },
        {
          path: 'login',
          name: 'login',
          component: Login
        },
        {
          path: 'register',
          name: 'register',
          component: Register
        }
      ]
    },
    {
      path: '/admin',
      component: AdminBaseLayout,
      children: [
        {
          path: '',
          name: 'dashboard',
          component: Dashboard
        },
        {
          path: 'home',
          name: 'home',
          component: Home
        },
        {
          path: 'about',
          name: 'about',
          component: About
        },
        {
          path: 'user-list',
          name: 'user-list',
          component: UserList
        }
      ]
    }
  ]
})
